/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.controller;

import org.xstgongyi.eduaid.dataobject.StudentBankAccountDO;
import org.xstgongyi.eduaid.dataobject.StudentDO;
import org.xstgongyi.eduaid.bo.Gender;

/**
 * @author oldcrane<br/>
 * @created 2019-04-12
 */
public class StudentVO {
	private Integer id;
	private Integer projectId;
	private String projectName;
	private String name;
	private Gender gender;
	private String idNumber;
	private String description;
	private Integer regSemesterId;
	private String regSemesterName;
	private String regSchool;
	private Integer regGradeId;
	private String regGradeName;
	private String sn;
	private Integer bankAccountId;
	private String bankAccountName;
	private String bankAccountNumber;
	private String bankAccountRelation;
	private String bankName;
	private String contactPhone;
	private String contactWechat;
	private String contactEmail;
	private String contactOther;
	private String povertyLevel;
	private Integer suggestAmount;
	private String status;

	static StudentVO of(StudentDO studentDO) {
		StudentVO vo = new StudentVO();
		vo.setId(studentDO.getId());
		vo.setProjectId(studentDO.getProjectId());
		vo.setName(studentDO.getName());
		vo.setGender(studentDO.getGender());
		vo.setIdNumber(studentDO.getIdNumber());
		vo.setDescription(studentDO.getDescription());
		vo.setRegSemesterId(studentDO.getRegSemesterId());
		vo.setRegSchool(studentDO.getRegSchool());
		vo.setRegGradeId(studentDO.getRegGradeId());
		vo.setSn(studentDO.getSn());
		vo.setBankAccountId(studentDO.getBankAccountId());
		vo.setContactPhone(studentDO.getContactPhone());
		vo.setContactWechat(studentDO.getContactWechat());
		vo.setContactEmail(studentDO.getContactEmail());
		vo.setContactOther(studentDO.getContactOther());
		//vo.setPovertyLevel(studentDO.getPovertyLevel());
		vo.setSuggestAmount(studentDO.getSuggestAmount());
		vo.setStatus(studentDO.getStatus());

		return vo;
	}

	StudentDO toDO() {
		StudentDO student = new StudentDO();
		student.setId(this.getId());
		student.setProjectId(this.getProjectId());
		student.setRegSemesterId(this.getRegSemesterId());
		student.setName(this.getName());
		student.setGender(this.getGender());
		student.setIdNumber(this.getIdNumber());
		student.setRegSchool(this.getRegSchool());
		student.setRegGradeId(this.getRegGradeId());
		student.setContactPhone(this.getContactPhone());
		student.setContactWechat(this.getContactWechat());
		student.setContactEmail(this.getContactEmail());
		student.setContactOther(this.getContactOther());
		student.setSuggestAmount(this.getSuggestAmount());
		student.setDescription(this.getDescription());

		return student;
	}

	StudentDO mergeToDo(StudentDO student) {
		if (null == student) {
			return null;
		}

		if (null != this.getName()) {
			student.setName(this.getName());
		}
		if (null != this.getGender()) {
			student.setGender(this.getGender());
		}
		if (null != this.getIdNumber()) {
			student.setIdNumber(this.getIdNumber());
		}
		if (null != this.getDescription()) {
			student.setDescription(this.getDescription());
		}
		if (null != this.getRegSchool()) {
			student.setRegSchool(this.getRegSchool());
		}
		if (null != this.getRegGradeId()) {
			student.setRegGradeId(this.getRegGradeId());
		}
		if (null != this.getContactPhone()) {
			student.setContactPhone(this.getContactPhone());
		}
		if (null != this.getContactWechat()) {
			student.setContactWechat(this.getContactWechat());
		}
		if (null != this.getContactEmail()) {
			student.setContactEmail(this.getContactEmail());
		}
		if (null != this.getContactOther()) {
			student.setContactOther(this.getContactOther());
		}
		if (null != this.getSuggestAmount()) {
			student.setSuggestAmount(this.getSuggestAmount());
		}

		return student;
	}

	StudentBankAccountDO toBankAccountDO() {
		StudentBankAccountDO bankAccount = new StudentBankAccountDO();
		bankAccount.setName(this.getBankAccountName());
		bankAccount.setNumber(this.getBankAccountNumber());
		bankAccount.setRelation(this.getBankAccountRelation());
		bankAccount.setBank(this.getBankName());
		return bankAccount;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getProjectId() {
		return projectId;
	}

	public void setProjectId(Integer projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getRegSemesterId() {
		return regSemesterId;
	}

	public void setRegSemesterId(Integer regSemesterId) {
		this.regSemesterId = regSemesterId;
	}

	public String getRegSemesterName() {
		return regSemesterName;
	}

	public void setRegSemesterName(String regSemesterName) {
		this.regSemesterName = regSemesterName;
	}

	public String getRegSchool() {
		return regSchool;
	}

	public void setRegSchool(String regSchool) {
		this.regSchool = regSchool;
	}

	public Integer getRegGradeId() {
		return regGradeId;
	}

	public void setRegGradeId(Integer regGradeId) {
		this.regGradeId = regGradeId;
	}

	public String getRegGradeName() {
		return regGradeName;
	}

	public void setRegGradeName(String regGradeName) {
		this.regGradeName = regGradeName;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Integer getBankAccountId() {
		return bankAccountId;
	}

	public void setBankAccountId(Integer bankAccountId) {
		this.bankAccountId = bankAccountId;
	}

	public String getBankAccountName() {
		return bankAccountName;
	}

	public void setBankAccountName(String bankAccountName) {
		this.bankAccountName = bankAccountName;
	}

	public String getBankAccountNumber() {
		return bankAccountNumber;
	}

	public void setBankAccountNumber(String bankAccountNumber) {
		this.bankAccountNumber = bankAccountNumber;
	}

	public String getBankAccountRelation() {
		return bankAccountRelation;
	}

	public void setBankAccountRelation(String bankAccountRelation) {
		this.bankAccountRelation = bankAccountRelation;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getContactPhone() {
		return contactPhone;
	}

	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}

	public String getContactWechat() {
		return contactWechat;
	}

	public void setContactWechat(String contactWechat) {
		this.contactWechat = contactWechat;
	}

	public String getContactEmail() {
		return contactEmail;
	}

	public void setContactEmail(String contactEmail) {
		this.contactEmail = contactEmail;
	}

	public String getContactOther() {
		return contactOther;
	}

	public void setContactOther(String contactOther) {
		this.contactOther = contactOther;
	}

	public String getPovertyLevel() {
		return povertyLevel;
	}

	public void setPovertyLevel(String povertyLevel) {
		this.povertyLevel = povertyLevel;
	}

	public Integer getSuggestAmount() {
		return suggestAmount;
	}

	public void setSuggestAmount(Integer suggestAmount) {
		this.suggestAmount = suggestAmount;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "StudentVO [id=" + id + ", projectId=" + projectId + ", projectName=" + projectName + ", name=" + name
				+ ", gender=" + gender + ", regSemesterId=" + regSemesterId + ", regSemesterName=" + regSemesterName
				+ ", sn=" + sn + ", bankAccountId=" + bankAccountId + ", povertyLevel=" + povertyLevel
				+ ", suggestAmount=" + suggestAmount + ", status=" + status + "]";
	}

}
